package cn.sitedev.prototype.general;

/**
 * @author qchen
 * @description 原型模式测试
 * @date 2020/9/18 1:17
 */
public class PrototypeTest {
    public static void main(String[] args) {
        // 创建原型对象
        ConcretePrototype concretePrototype = new ConcretePrototype();
        concretePrototype.setAge(109);
        concretePrototype.setName("zhangsan");
        System.out.println("prototype: " + concretePrototype);

        // 拷贝原型对象
        ConcretePrototype cloneType = concretePrototype.clone();
        System.out.println("cloneType: " + cloneType);
    }
}
